package cn.teduymdj.jxc.service;


import cn.teduymdj.jxc.pojo.dto.*;
import cn.teduymdj.jxc.pojo.entity.PurchaseList;
import cn.teduymdj.jxc.pojo.entity.PurchaseListGoods;
import cn.teduymdj.jxc.pojo.vo.PurchaseListCountListItemVO;
import cn.teduymdj.jxc.pojo.vo.PurchaseListGoodsListItemVO;
import cn.teduymdj.jxc.pojo.vo.PurchaseListListItemVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 进货商品service接口
 *
 */
@Transactional(rollbackFor = Exception.class)
public interface PurchaseListGoodsService {
	
	/**
	 * 保存商品进货清单，商品进货列表，修改商品属性
	 * @param purchaseListAddNewDTO 商品进货单
	 * @param purchaseListGoodsAddNewDTOList 商品进货列表
	 */
	public void save(PurchaseListAddNewDTO02 purchaseListAddNewDTO);
	
	/**
	 * 进货单查询
	 * @param purchaseNumber 单号
	 * @param supplierId 供应商ID
	 * @param state 付款状态
	 * @param sTime 开始时间
	 * @param eTime 结束时间
	 * @return
	 */
	public List<PurchaseListListItemVO> getPurchaselist(SelectPurchaseListCondition selectPurchaseListCondition);
	
	/**
	 * 根据进货单ID查询进货商品信息
	 * @param purchaseListId 进货单ID
	 * @return
	 */
	public List<PurchaseListGoodsListItemVO> getPurchaseListGoodsByPurchaseListId(Long purchaseListId);
	
	/**
	 * 删除进货单及进货单商品信息
	 * @param purchaseListId 进货单ID
	 */
	public void delete(Long purchaseListId);
	
	/**
	 * 根据进货单ID查询进货单信息
	 * @param purchaseListId 进货单ID
	 * @return
	 */
	public PurchaseList getPurchaseList(Long purchaseListId);
	
	/**
	 * 修改进货单付款状态
	 * @param state 1：已付 2：未付
	 * @param id 付款单ID
	 */
    public void updateState(Integer state ,Long id);
    
    /**
	 * 根据进货单ID条件查询进货商品信息
	 * @param purchaseListId 进货单ID
	 * @param goodsTypeId 商品类别ID
	 * @param codeOrName 商品编码或名称
	 * @return 
	 */
	public List<PurchaseListGoodsListItemVO> getPurchaseListGoodsByPurchaseListId(Long purchaseListId, Long goodsTypeId, String codeOrName);

	/**
	 * 修改进货单付款状态为已支付
	 *
	 * @param id 进货单ID
	 * @return
	 */
	void setPaid(Long id);
	/**
	 * 修改进货单付款状态为未支付
	 *
	 * @param id 进货单ID
	 * @return
	 */
	void setUnpaid(Long id);

    List<PurchaseListCountListItemVO> listByCondition(SelectReturnCondition selectReturnCondition);
}
